# List

print('---------List--------')
l = ['a'] * 3
print(l)

my_list = ['a', 'b', 'c']
# append()
my_list.append('d')
my_list.append('f')
print(my_list)

# insert
my_list.insert(2, 'g')
my_list.insert(1, 'a')
print(my_list)
# 切片
print(my_list[-1])
print(my_list[1:4:2])
# index()
print(my_list.index('g'))
my_list.remove('d')
print(my_list)
print(my_list.count('a'))
my_list.sort()
print(my_list)

my_list_new = sorted(my_list)
print(my_list_new)

# Tuple
print('---------Tuple--------')
my_tuple = (1, 2, 3, 4, 5)
print(my_tuple[2])
print(my_tuple[2:5])

# Dict
print('---------Dict--------')
my_dict = {'aa': 11, 'bb': 22}
my_dict_text = {'dd': 12}
my_dict.setdefault('b', 1)
my_dict.update(my_dict_text)
print(my_dict)

print(my_dict.get('aa'))
print(my_dict.get('cc'))
print(my_dict.get('cc', 44))
print(my_dict.keys())
print(my_dict.values())
print(my_dict.items())
print(my_dict.pop('dd'))

print(my_dict_text.clear())

# Set
print('---------Set--------')
my_set = {11, 'a', 'v', 'd'}
my_set_test = {'c', 'd', 'g'}
print(my_set)
print('c' in my_set)

print(my_set.union(my_set_test))
my_set.update(my_set_test)
print(my_set)
print('c' in my_set)
my_set.remove(11)
print(my_set)
my_set.pop()
print(my_set)



"""
四类数据基本类型 `crud` 接口是否可用:

   TYPE   |    C(create)   |  R(Retrieve)  | U (update)  |   D (delete)
List(列表) |     √          |      √       |     √        |     √
Tuple(元组)|     -          |      √       |     -        |     -
Dict(字典) |     √          |      √       |     √        |     √
Set(集合)  |     √          |      √       |     √        |     √

"""
